/*
 * @Description: 判断是否是calc
 * @Autor: lcz
 * @Date: 2022-11-03 14:53:41
 * @LastEditors: lcz
 * @LastEditTime: 2022-11-03 15:25:59
 */
export function isCalc(str: string): boolean | Error {
  if (typeof str != 'string') {
    throw new Error('isCalc 必须传字符串');
  }
  const start = str.slice(0, 5);
  const end = str.slice(-1);
  const center = str.slice(5, str.length - 1);
  if (start === 'calc(' && end == ')' && !!center) {
    return true;
  }
  return false;
}
